package com.andaily.domain.dto.cooking;

import com.andaily.domain.dto.AbstractDTO;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;

/**
 * @author Shengzhao Li
 */
public class SettlementFormDto extends AbstractDTO {

    private List<CookingAccountDto> accounts = new ArrayList<CookingAccountDto>();
    private String recordedAmount = "0";
    //For bind checked accounts
    private String[] accountGuids;

    public SettlementFormDto() {
    }

    public int getAccountSize() {
        return accounts.size();
    }

    public List<CookingAccountDto> getAccounts() {
        return accounts;
    }

    public void setAccounts(List<CookingAccountDto> accounts) {
        this.accounts = accounts;
    }

    public String getRecordedAmount() {
        return recordedAmount;
    }

    public void setRecordedAmount(String recordedAmount) {
        this.recordedAmount = recordedAmount;
    }

    public String[] getAccountGuids() {
        return accountGuids;
    }

    public void setAccountGuids(String[] accountGuids) {
        this.accountGuids = accountGuids;
    }

    public void updateAmount(BigDecimal recordedAmount) {
        if (recordedAmount != null) {
            this.recordedAmount = recordedAmount.toString();
        }
    }
}
